package experiment;

public class UpdateIOperation implements IOperation{
    @Override
    public void work(EmployeeList employeeList) {
        System.out.println("请输入要修改的员工姓名：");
        String name = scanner.next();
        if(employeeList.findEmployee(name)){
            System.out.println("请输入你要修改的员工编号：");
            String coding = scanner.next();
            System.out.println("请输入你要修改的员工出生年月：");
            String birth = scanner.next();
            System.out.println("请输入你要修改的员工性别：");
            String sex = scanner.next();
            System.out.println("请输入你要修改的员工所在部门：");
            String dCoding = scanner.next();
            String dName = scanner.next();
            Department department = new Department(dCoding,dName);
            employeeList.updateEmployee(name,coding,sex,birth,department);
        }else{
            System.out.println("你要修改的员工不存在");
        }
    }
}
